package exception._5_21;

public class ThrowDemo {
    public static void main(String[] args) {//永远不要在main写抛出异常
        Person p=new Person();

        try {
            p.setAge(1000);
        } catch (Exception e) {
            System.out.println("年龄设置失败");
        }
        System.out.println("此人年龄:"+p.getAge());
    }
}
